projects
/
ostree.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
01a3a65
)
lib/checksum-utils: Use g_memdup()
author
Colin Walters
<walters@verbum.org>
Fri, 18 Oct 2019 15:06:51 +0000
(15:06 +0000)
committer
Colin Walters
<walters@verbum.org>
Fri, 18 Oct 2019 15:07:39 +0000
(15:07 +0000)
This is clearer and silences a scan-build warning.
src/libotutil/ot-checksum-utils.c
patch
|
blob
|
history
diff --git
a/src/libotutil/ot-checksum-utils.c
b/src/libotutil/ot-checksum-utils.c
index 6eb6fdc03b440abcec981e938fc2711f4e59dd74..667673689e12b6cc6754fc34928589002c3ebf6d 100644
(file)
--- a/
src/libotutil/ot-checksum-utils.c
+++ b/
src/libotutil/ot-checksum-utils.c
@@
-250,9
+250,8
@@
ot_gio_splice_get_checksum (GOutputStream *out,
guint8 digest[_OSTREE_SHA256_DIGEST_LEN];
ot_checksum_get_digest (&checksum, digest, sizeof (digest));
- g_autofree guchar *ret_csum = g_malloc (sizeof (digest));
- memcpy (ret_csum, digest, sizeof (digest));
- ot_transfer_out_value (out_csum, &ret_csum);
+ if (out_csum)
+ *out_csum = g_memdup (digest, sizeof (digest));
return TRUE;
}